package com.njy.aop.test;

public class lambda {
    public static void main(String[] args) {
        int[] nums = {1,100,50,2,3,20};
        sleepSort(nums);
    }
    public static void sleepSort(int[] nums){
        for (int i = 0; i < nums.length; i++) {
            int num = nums[i];
            new Thread(()->{
                try {
                    Thread.sleep(num);
                    System.out.println(num);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }).start();
        }

    }
}
